import axios from './axios'
import qs from 'qs'
import {baseUrl} from '@/config/config'
var preUrl = baseUrl + '/dorm/api/app/task'
// 获取所有下发任务
export const getTask = (params) => {
    return new Promise((resolve, reject) => {
        axios({
            url: preUrl,
            method: 'get',
            params
        }).then(res => {
          resolve(res.data)
        })
    })
}
// 刷新导入进度 /dorm/api/app/build/personImportDeviceProgress
export const refreshProgress = (params) => {
    return new Promise((resolve, reject) => {
        axios({
            url: baseUrl + '/dorm/api/app/build/personImportDeviceProgress',
            method: 'get',
            params
        }).then(res => {
            resolve(res.data)
        })
    })
}
// 获取任务详情
export const getTaskDetail = (params) => {
    return new Promise((resolve, reject) => {
        axios({
            url: preUrl + '/' + params.id,
            method: 'get'
        }).then(res => {
            resolve(res.data)
        })
    })
}
// /dorm/api/app/task/realoadLocation 实时查房刷新定位
export const realoadLocation = (data) => {
    return new Promise((resolve, reject) => {
        axios({
            url: preUrl + 'realoadLocation',
            method: 'POST',
            data
        }).then(res => {
          resolve(res.data)
        })
    })
}
// /dorm/api/app/task/pageWardRound 实时查房获取数据
export const pageWardRound = (params) => {
    return new Promise((resolve, reject) => {
        axios({
            url: preUrl + 'pageWardRound',
            method: 'get',
            params
        }).then(res => {
          resolve(res.data)
        })
    })
}
// /dorm/api/app/task/monitor 读取宿舍考勤监控
export const monitor = (params) => {
    return new Promise((resolve, reject) => {
        axios({
            url: preUrl + 'monitor',
            method: 'get',
            params
        }).then(res => {
          resolve(res.data)
        })
    })
}
// 查询任务人员导入进度 /dorm/api/app/build/personImportDeviceProgress
export const personImportDeviceStatus = (params) => {
    return new Promise((resolve, reject) => {
        axios({
            url: baseUrl + '/dorm/api/app/build/personImportDeviceStatus',
            method: 'get',
            params
        }).then(res => {
          resolve(res.data)
        })
    })
}
